home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1998-10-30 | 107.0 KB | 1,717 lines
ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) NNNNAAAAMMMMEEEE canvas - Create and manipulate canvas widgets SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS ccccaaaannnnvvvvaaaassss _p_a_t_h_N_a_m_e ?_o_p_t_i_o_n_s? SSSSTTTTAAAANNNNDDDDAAAARRRRDDDD OOOOPPPPTTTTIIIIOOOONNNNSSSS bbbbaaaacccckkkkggggrrrroooouuuunnnndddd hhhhiiiigggghhhhlllliiiigggghhhhttttTTTThhhhiiiicccckkkknnnneeeessssssss iiiinnnnsssseeeerrrrttttWWWWiiiiddddtttthhhhttttaaaakkkkeeeeFFFFooooccccuuuussss | bbbboooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh iiiinnnnsssseeeerrrrttttBBBBaaaacccckkkkggggrrrroooouuuunnnndddd rrrreeeelllliiiieeeeffffxxxxSSSSccccrrrroooollllllllCCCCoooommmmmmmmaaaannnndddd | ccccuuuurrrrssssoooorrrr iiiinnnnsssseeeerrrrttttBBBBoooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh sssseeeelllleeeeccccttttBBBBaaaacccckkkkggggrrrroooouuuunnnnddddyyyySSSSccccrrrroooollllllllCCCCoooommmmmmmmaaaannnndddd | hhhhiiiigggghhhhlllliiiigggghhhhttttCCCCoooolllloooorrrr iiiinnnnsssseeeerrrrttttOOOOffffffffTTTTiiiimmmmeeee sssseeeelllleeeeccccttttBBBBoooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh | hhhhiiiigggghhhhlllliiiigggghhhhttttBBBBaaaacccckkkkggggrrrroooouuuunnnndddd iiiinnnnsssseeeerrrrttttOOOOnnnnTTTTiiiimmmmeeee sssseeeelllleeeeccccttttFFFFoooorrrreeeeggggrrrroooouuuunnnndddd See the ``options'' manual entry for details on the standard options. WWWWIIIIDDDDGGGGEEEETTTT----SSSSPPPPEEEECCCCIIIIFFFFIIIICCCC OOOOPPPPTTTTIIIIOOOONNNNSSSS Name: cccclllloooosssseeeeEEEEnnnnoooouuuugggghhhh Class: CCCClllloooosssseeeeEEEEnnnnoooouuuugggghhhh Command-Line Switch:----cccclllloooosssseeeeeeeennnnoooouuuugggghhhh Specifies a floating-point value indicating how close the mouse cursor must be to an item before it is considered to be ``inside'' the item. Defaults to 1.0. Name: ccccoooonnnnffffiiiinnnneeee Class: CCCCoooonnnnffffiiiinnnneeee Command-Line Switch:----ccccoooonnnnffffiiiinnnneeee Specifies a boolean value that indicates whether or not it should be allowable to set the canvas's view outside the region defined by the ssssccccrrrroooollllllllRRRReeeeggggiiiioooonnnn argument. Defaults to true, which means that the view will be constrained within the scroll region. Name: hhhheeeeiiiigggghhhhtttt Class: HHHHeeeeiiiigggghhhhtttt Command-Line Switch:----hhhheeeeiiiigggghhhhtttt Specifies a desired window height that the canvas widget should request from its geometry manager. The value may be specified in any of the forms described in the COORDINATES section below. Name: ssssccccrrrroooollllllllRRRReeeeggggiiiioooonnnn Class: SSSSccccrrrroooollllllllRRRReeeeggggiiiioooonnnn Command-Line Switch:----ssssccccrrrroooollllllllrrrreeeeggggiiiioooonnnn Specifies a list with four coordinates describing the left, top, right, and bottom coordinates of a rectangular region. This region is used for scrolling purposes and is considered to be the boundary of the information in the canvas. Each of the coordinates may be specified in any of the forms given in the COORDINATES section below. PPPPaaaaggggeeee 1111 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) Name: wwwwiiiiddddtttthhhh Class: wwwwiiiiddddtttthhhh Command-Line Switch:----wwwwiiiiddddtttthhhh Specifies a desired window width that the canvas widget should request from its geometry manager. The value may be specified in any of the forms described in the COORDINATES section below. Name: xxxxSSSSccccrrrroooollllllllIIIInnnnccccrrrreeeemmmmeeeennnntttt | Class: SSSSccccrrrroooollllllllIIIInnnnccccrrrreeeemmmmeeeennnntttt | Command-Line Switch:----xxxxssssccccrrrroooolllllllliiiinnnnccccrrrreeeemmmmeeeennnntttt | Specifies an increment for horizontal scrolling, in any of the usual forms permitted for screen distances. If the value of this option is greater than zero, the horizontal view in the window will be constrained so that the canvas x coordinate at the left edge of the window is always an even multiple of xxxxSSSSccccrrrroooollllllllIIIInnnnccccrrrreeeemmmmeeeennnntttt; furthermore, the units for scrolling (e.g., the change in view when the left and right arrows of a scrollbar are selected) will also be xxxxSSSSccccrrrroooollllllllIIIInnnnccccrrrreeeemmmmeeeennnntttt. If the value of this option is less than or equal to zero, then horizontal scrolling is unconstrained. Name: yyyySSSSccccrrrroooollllllllIIIInnnnccccrrrreeeemmmmeeeennnntttt | Class: SSSSccccrrrroooollllllllIIIInnnnccccrrrreeeemmmmeeeennnntttt | Command-Line Switch:----yyyyssssccccrrrroooolllllllliiiinnnnccccrrrreeeemmmmeeeennnntttt | Specifies an increment for vertical scrolling, in any of the usual forms permitted for screen distances. If the value of this option is greater than zero, the vertical view in the window will be constrained so that the canvas y coordinate at the top edge of the window is always an even multiple of yyyySSSSccccrrrroooollllllllIIIInnnnccccrrrreeeemmmmeeeennnntttt; furthermore, the units for scrolling (e.g., the change in view when the top and bottom arrows of a scrollbar are selected) will also be yyyySSSSccccrrrroooollllllllIIIInnnnccccrrrreeeemmmmeeeennnntttt. If the value of this option is less than or equal to zero, then vertical scrolling is unconstrained. IIIINNNNTTTTRRRROOOODDDDUUUUCCCCTTTTIIIIOOOONNNN The ccccaaaannnnvvvvaaaassss command creates a new window (given by the _p_a_t_h_N_a_m_e argument) and makes it into a canvas widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the canvas such as its colors and 3-D relief. The ccccaaaannnnvvvvaaaassss command returns its _p_a_t_h_N_a_m_e argument. At the time this command is invoked, there must not exist a window named _p_a_t_h_N_a_m_e, but _p_a_t_h_N_a_m_e's parent must exist. Canvas widgets implement structured graphics. A canvas displays any number of _i_t_e_m_s, which may be things like rectangles, circles, lines, and text. Items may be manipulated (e.g. moved or re-colored) and commands may be associated with items in much the same way that the bbbbiiiinnnndddd command allows commands to be bound to widgets. For example, a particular command may be associated with the <Button-1> event so that the command PPPPaaaaggggeeee 2222 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) is invoked whenever button 1 is pressed with the mouse cursor over an item. This means that items in a canvas can have behaviors defined by the Tcl scripts bound to them. DDDDIIIISSSSPPPPLLLLAAAAYYYY LLLLIIIISSSSTTTT The items in a canvas are ordered for purposes of display, with the first item in the display list being displayed first, followed by the next item in the list, and so on. Items later in the display list obscure those that are earlier in the display list and are sometimes referred to as being ``on top'' of earlier items. When a new item is created it is placed at the end of the display list, on top of everything else. Widget commands may be used to re-arrange the order of the display list. IIIITTTTEEEEMMMM IIIIDDDDSSSS AAAANNNNDDDD TTTTAAAAGGGGSSSS Items in a canvas widget may be named in either of two ways: by id or by tag. Each item has a unique identifying number which is assigned to that item when it is created. The id of an item never changes and id numbers are never re-used within the lifetime of a canvas widget. Each item may also have any number of _t_a_g_s associated with it. A tag is just a string of characters, and it may take any form except that of an integer. For example, ``x123'' is OK but ``123'' isn't. The same tag may be associated with many different items. This is commonly done to group items in various interesting ways; for example, all selected items might be given the tag ``selected''. The tag aaaallllllll is implicitly associated with every item in the canvas; it may be used to invoke operations on all the items in the canvas. The tag ccccuuuurrrrrrrreeeennnntttt is managed automatically by Tk; it applies to the _c_u_r_r_e_n_t _i_t_e_m, which is the topmost item whose drawn area covers the position of the mouse cursor. If the mouse is not in the canvas widget or is not over an item, then no item has the ccccuuuurrrrrrrreeeennnntttt tag. When specifying items in canvas widget commands, if the specifier is an integer then it is assumed to refer to the single item with that id. If the specifier is not an integer, then it is assumed to refer to all of the items in the canvas that have a tag matching the specifier. The symbol _t_a_g_O_r_I_d is used below to indicate that an argument specifies either an id that selects a single item or a tag that selects zero or more items. Some widget commands only operate on a single item at a time; if _t_a_g_O_r_I_d is specified in a way that names multiple items, then the normal behavior is for the command to use the first (lowest) of these items in the display list that is suitable for the command. Exceptions are noted in the widget command descriptions below. PPPPaaaaggggeeee 3333 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) COORDINATES All coordinates related to canvases are stored as floating-point numbers. Coordinates and distances are specified in screen units, which are floating-point numbers optionally followed by one of several letters. If no letter is supplied then the distance is in pixels. If the letter is mmmm then the distance is in millimeters on the screen; if it is cccc then the distance is in centimeters; iiii means inches, and pppp means printers points (1/72 inch). Larger y-coordinates refer to points lower on the screen; larger x-coordinates refer to points farther to the right. TTTTRRRRAAAANNNNSSSSFFFFOOOORRRRMMMMAAAATTTTIIIIOOOONNNNSSSS Normally the origin of the canvas coordinate system is at the upper-left corner of the window containing the canvas. It is possible to adjust the origin of the canvas coordinate system relative to the origin of the window using the xxxxvvvviiiieeeewwww and yyyyvvvviiiieeeewwww widget commands; this is typically used for scrolling. Canvases do not support scaling or rotation of the canvas coordinate system relative to the window coordinate system. Indidividual items may be moved or scaled using widget commands described below, but they may not be rotated. IIIINNNNDDDDIIIICCCCEEEESSSS Text items support the notion of an _i_n_d_e_x for identifying particular positions within the item. Indices are used for commands such as inserting text, deleting a range of characters, and setting the insertion cursor position. An index may be specified in any of a number of ways, and different types of items may support different forms for specifying indices. Text items support the following forms for an index; if you define new types of text-like items, it would be advisable to support as many of these forms as practical. Note that it is possible to refer to the character just after the last one in the text item; this is necessary for such tasks as inserting new text at the end of the item. _n_u_m_b_e_r A decimal number giving the position of the desired character within the text item. 0 refers to the first character, 1 to the next character, and so on. A number less than 0 is treated as if it were zero, and a number greater than the length of the text item is treated as if it were equal to the length of the text item. eeeennnndddd Refers to the character just after the last one in the item (same as the number of characters in the item). iiiinnnnsssseeeerrrrtttt Refers to the character just before which the insertion cursor is drawn in this item. sssseeeellll....ffffiiiirrrrsssstttt Refers to the first selected character in the item. If the selection isn't in this item then this form is illegal. PPPPaaaaggggeeee 4444 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) sssseeeellll....llllaaaasssstttt Refers to the last selected character in the item. If the selection isn't in this item then this form is illegal. @@@@_x,_y Refers to the character at the point given by _x and _y, where _x and _y are specified in the coordinate system of the canvas. If _x and _y lie outside the coordinates covered by the text item, then they refer to the first or last character in the line that is closest to the given point. WWWWIIIIDDDDGGGGEEEETTTT CCCCOOOOMMMMMMMMAAAANNNNDDDD The ccccaaaannnnvvvvaaaassss command creates a new Tcl command whose name is _p_a_t_h_N_a_m_e. This command may be used to invoke various operations on the widget. It has the following general form: _p_a_t_h_N_a_m_e _o_p_t_i_o_n ?_a_r_g _a_r_g ...? _O_p_t_i_o_n and the _a_r_gs determine the exact behavior of the command. The following widget commands are possible for canvas widgets: _p_a_t_h_N_a_m_e aaaaddddddddttttaaaagggg _t_a_g _s_e_a_r_c_h_S_p_e_c ?_a_r_g _a_r_g ...? For each item that meets the constraints specified by _s_e_a_r_c_h_S_p_e_c and the _a_r_gs, add _t_a_g to the list of tags associated with the item if it isn't already present on that list. It is possible that no items will satisfy the constraints given by _s_e_a_r_c_h_S_p_e_c _a_n_d _a_r_gs, in which case the command has no effect. This command returns an empty string as result. _S_e_a_r_c_h_S_p_e_c and _a_r_g's may take any of the following forms: aaaabbbboooovvvveeee _t_a_g_O_r_I_d Selects the item just after (above) the one given by _t_a_g_O_r_I_d in the display list. If _t_a_g_O_r_I_d denotes more than one item, then the last (topmost) of these items in the display list is used. aaaallllllll Selects all the items in the canvas. bbbbeeeelllloooowwww _t_a_g_O_r_I_d Selects the item just before (below) the one given by _t_a_g_O_r_I_d in the display list. If _t_a_g_O_r_I_d denotes more than one item, then the first (lowest) of these items in the display list is used. cccclllloooosssseeeesssstttt _x _y ?_h_a_l_o? ?_s_t_a_r_t? Selects the item closest to the point given by _x and _y. If more than one item is at the same closest distance (e.g. two items overlap the point), then the top-most of these items (the last one in the display list) is used. If _h_a_l_o is specified, then it must be a non-negative value. Any item closer than _h_a_l_o to the point is considered to overlap it. The _s_t_a_r_t argument may be used to step circularly through all the closest items. If _s_t_a_r_t is specified, it names an item using a tag or id (if by tag, it selects the first item in the display list PPPPaaaaggggeeee 5555 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) with the given tag). Instead of selecting the topmost closest item, this form will select the topmost closest item that is below _s_t_a_r_t in the display list; if no such item exists, then the selection behaves as if the _s_t_a_r_t argument had not been specified. eeeennnncccclllloooosssseeeedddd _x_1 _y_1 _x_2 _y_2 Selects all the items completely enclosed within the rectangular region given by _x_1, _y_1, _x_2, and _y_2. _X_1 must be no greater then _x_2 and _y_1 must be no greater than _y_2. oooovvvveeeerrrrllllaaaappppppppiiiinnnngggg _x_1 _y_1 _x_2 _y_2 Selects all the items that overlap or are enclosed within the rectangular region given by _x_1, _y_1, _x_2, and _y_2. _X_1 must be no greater then _x_2 and _y_1 must be no greater than _y_2. wwwwiiiitttthhhhttttaaaagggg _t_a_g_O_r_I_d Selects all the items given by _t_a_g_O_r_I_d. _p_a_t_h_N_a_m_e bbbbbbbbooooxxxx _t_a_g_O_r_I_d ?_t_a_g_O_r_I_d _t_a_g_O_r_I_d ...? Returns a list with four elements giving an approximate bounding box for all the items named by the _t_a_g_O_r_I_d arguments. The list has the form ``_x_1 _y_1 _x_2 _y_2'' such that the drawn areas of all the named elements are within the region bounded by _x_1 on the left, _x_2 on the right, _y_1 on the top, and _y_2 on the bottom. The return value may overestimate the actual bounding box by a few pixels. If no items match any of the _t_a_g_O_r_I_d arguments then an empty string is returned. _p_a_t_h_N_a_m_e bbbbiiiinnnndddd _t_a_g_O_r_I_d ?_s_e_q_u_e_n_c_e? ?_c_o_m_m_a_n_d? This command associates _c_o_m_m_a_n_d with all the items given by _t_a_g_O_r_I_d such that whenever the event sequence given by _s_e_q_u_e_n_c_e occurs for one of the items the command will be invoked. This widget command is similar to the bbbbiiiinnnndddd command except that it operates on items in a canvas rather than entire widgets. See the bbbbiiiinnnndddd manual entry for complete details on the syntax of _s_e_q_u_e_n_c_e and the substitutions performed on _c_o_m_m_a_n_d before invoking it. If all arguments are specified then a new binding is created, replacing any existing binding for the same _s_e_q_u_e_n_c_e and _t_a_g_O_r_I_d (if the first character of _c_o_m_m_a_n_d is ``+'' then _c_o_m_m_a_n_d augments an existing binding rather than replacing it). In this case the return value is an empty string. If _c_o_m_m_a_n_d is omitted then the command returns the _c_o_m_m_a_n_d associated with _t_a_g_O_r_I_d and _s_e_q_u_e_n_c_e (an error occurs if there is no such binding). If both _c_o_m_m_a_n_d and _s_e_q_u_e_n_c_e are omitted then the command returns a list of all the sequences for which bindings have been defined for _t_a_g_O_r_I_d. The only events for which bindings may be specified are those related to the mouse and keyboard, such as EEEEnnnntttteeeerrrr, LLLLeeeeaaaavvvveeee, BBBBuuuuttttttttoooonnnnPPPPrrrreeeessssssss, MMMMoooottttiiiioooonnnn, and KKKKeeeeyyyyPPPPrrrreeeessssssss. The handling of events in canvases uses the current item defined in ITEM IDS AND TAGS above. EEEEnnnntttteeeerrrr and LLLLeeeeaaaavvvveeee events trigger for an item when it becomes the current item or ceases to be the current item; note that these PPPPaaaaggggeeee 6666 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) events are different than EEEEnnnntttteeeerrrr and LLLLeeeeaaaavvvveeee events for windows. Mouse-related events are directed to the current item, if any. Keyboard-related events are directed to the focus item, if any (see the ffffooooccccuuuussss widget command below for more on this). It is possible for multiple bindings to match a particular event. | This could occur, for example, if one binding is associated with the| item's id and another is associated with one of the item's tags. | When this occurs, all of the matching bindings are invoked. A | binding associated with the aaaallllllll tag is invoked first, followed by | one binding for each of the item's tags (in order), followed by a | binding associated with the item's id. If there are multiple | matching bindings for a single tag, then only the most specific | binding is invoked. A ccccoooonnnnttttiiiinnnnuuuueeee command in a binding script | terminates that script, and a bbbbrrrreeeeaaaakkkk command terminates that script | and skips any remaining scripts for the event, just as for the bbbbiiiinnnndddd | command. | If bindings have been created for a canvas window using the bbbbiiiinnnndddd | command, then they are invoked in addition to bindings created for | the canvas's items using the bbbbiiiinnnndddd widget command. The bindings for | items will be invoked before any of the bindings for the window as a| whole. _p_a_t_h_N_a_m_e ccccaaaannnnvvvvaaaassssxxxx _s_c_r_e_e_n_x ?_g_r_i_d_s_p_a_c_i_n_g? Given a screen x-coordinate _s_c_r_e_e_n_x this command returns the canvas x-coordinate that is displayed at that location. If _g_r_i_d_s_p_a_c_i_n_g is specified, then the canvas coordinate is rounded to the nearest multiple of _g_r_i_d_s_p_a_c_i_n_g units. _p_a_t_h_N_a_m_e ccccaaaannnnvvvvaaaassssyyyy _s_c_r_e_e_n_y ?_g_r_i_d_s_p_a_c_i_n_g? Given a screen y-coordinate _s_c_r_e_e_n_y this command returns the canvas y-coordinate that is displayed at that location. If _g_r_i_d_s_p_a_c_i_n_g is specified, then the canvas coordinate is rounded to the nearest multiple of _g_r_i_d_s_p_a_c_i_n_g units. _p_a_t_h_N_a_m_e ccccggggeeeetttt _o_p_t_i_o_n Returns the current value of the configuration option given by | _o_p_t_i_o_n. _O_p_t_i_o_n may have any of the values accepted by the ccccaaaannnnvvvvaaaassss | command. _p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee ????_o_p_t_i_o_n? ?_v_a_l_u_e? ?_o_p_t_i_o_n _v_a_l_u_e ...? Query or modify the configuration options of the widget. If no _o_p_t_i_o_n is specified, returns a list describing all of the available options for _p_a_t_h_N_a_m_e (see TTTTkkkk____CCCCoooonnnnffffiiiigggguuuurrrreeeeIIIInnnnffffoooo for information on the format of this list). If _o_p_t_i_o_n is specified with no _v_a_l_u_e, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no _o_p_t_i_o_n is specified). If one or more _o_p_t_i_o_n-_v_a_l_u_e pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. _O_p_t_i_o_n may have any of the values accepted PPPPaaaaggggeeee 7777 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) by the ccccaaaannnnvvvvaaaassss command. _p_a_t_h_N_a_m_e ccccoooooooorrrrddddssss _t_a_g_O_r_I_d ?_x_0 _y_0 ...? Query or modify the coordinates that define an item. If no coordinates are specified, this command returns a list whose elements are the coordinates of the item named by _t_a_g_O_r_I_d. If coordinates are specified, then they replace the current coordinates for the named item. If _t_a_g_O_r_I_d refers to multiple items, then the first one in the display list is used. _p_a_t_h_N_a_m_e ccccrrrreeeeaaaatttteeee _t_y_p_e _x _y ?_x _y ...? ?_o_p_t_i_o_n _v_a_l_u_e ...? Create a new item in _p_a_t_h_N_a_m_e of type _t_y_p_e. The exact format of the arguments after ttttyyyyppppeeee depends on ttttyyyyppppeeee, but usually they consist of the coordinates for one or more points, followed by specifications for zero or more item options. See the subsections on individual item types below for more on the syntax of this command. This command returns the id for the new item. _p_a_t_h_N_a_m_e ddddcccchhhhaaaarrrrssss _t_a_g_O_r_I_d _f_i_r_s_t ?_l_a_s_t? For each item given by _t_a_g_O_r_I_d, delete the characters in the range given by _f_i_r_s_t and _l_a_s_t, inclusive. If some of the items given by _t_a_g_O_r_I_d don't support text operations, then they are ignored. _F_i_r_s_t and _l_a_s_t are indices of characters within the item(s) as described in INDICES above. If _l_a_s_t is omitted, it defaults to _f_i_r_s_t. This command returns an empty string. _p_a_t_h_N_a_m_e ddddeeeelllleeeetttteeee ?_t_a_g_O_r_I_d _t_a_g_O_r_I_d ...? Delete each of the items given by each _t_a_g_O_r_I_d, and return an empty string. _p_a_t_h_N_a_m_e ddddttttaaaagggg _t_a_g_O_r_I_d ?_t_a_g_T_o_D_e_l_e_t_e? For each of the items given by _t_a_g_O_r_I_d, delete the tag given by _t_a_g_T_o_D_e_l_e_t_e from the list of those associated with the item. If an item doesn't have the tag _t_a_g_T_o_D_e_l_e_t_e then the item is unaffected by the command. If _t_a_g_T_o_D_e_l_e_t_e is omitted then it defaults to _t_a_g_O_r_I_d. This command returns an empty string. _p_a_t_h_N_a_m_e ffffiiiinnnndddd _s_e_a_r_c_h_C_o_m_m_a_n_d ?_a_r_g _a_r_g ...? This command returns a list consisting of all the items that meet the constraints specified by _s_e_a_r_c_h_C_o_m_m_a_n_d and _a_r_g's. _S_e_a_r_c_h_C_o_m_m_a_n_d and _a_r_g_s have any of the forms accepted by the aaaaddddddddttttaaaagggg command. _p_a_t_h_N_a_m_e ffffooooccccuuuussss ?_t_a_g_O_r_I_d? Set the keyboard focus for the canvas widget to the item given by _t_a_g_O_r_I_d. If _t_a_g_O_r_I_d refers to several items, then the focus is set to the first such item in the display list that supports the insertion cursor. If _t_a_g_O_r_I_d doesn't refer to any items, or if none of them support the insertion cursor, then the focus isn't changed. If _t_a_g_O_r_I_d is an empty string, then the focus item is reset so that no item has the focus. If _t_a_g_O_r_I_d is not specified then the command returns the id for the item that currently has the focus, or an empty string if no item has the focus. PPPPaaaaggggeeee 8888 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) Once the focus has been set to an item, the item will display the insertion cursor and all keyboard events will be directed to that item. The focus item within a canvas and the focus window on the screen (set with the ffffooooccccuuuussss command) are totally independent: a given item doesn't actually have the input focus unless (a) its canvas is the focus window and (b) the item is the focus item within the canvas. In most cases it is advisable to follow the ffffooooccccuuuussss widget command with the ffffooooccccuuuussss command to set the focus window to the canvas (if it wasn't there already). _p_a_t_h_N_a_m_e ggggeeeettttttttaaaaggggssss _t_a_g_O_r_I_d Return a list whose elements are the tags associated with the item given by _t_a_g_O_r_I_d. If _t_a_g_O_r_I_d refers to more than one item, then the tags are returned from the first such item in the display list. If _t_a_g_O_r_I_d doesn't refer to any items, or if the item contains no tags, then an empty string is returned. _p_a_t_h_N_a_m_e iiiiccccuuuurrrrssssoooorrrr _t_a_g_O_r_I_d _i_n_d_e_x Set the position of the insertion cursor for the item(s) given by _t_a_g_O_r_I_d to just before the character whose position is given by _i_n_d_e_x. If some or all of the items given by _t_a_g_O_r_I_d don't support an insertion cursor then this command has no effect on them. See INDICES above for a description of the legal forms for _i_n_d_e_x. Note: the insertion cursor is only displayed in an item if that item currently has the keyboard focus (see the widget command ffffooooccccuuuussss, below), but the cursor position may be set even when the item doesn't have the focus. This command returns an empty string. _p_a_t_h_N_a_m_e iiiinnnnddddeeeexxxx _t_a_g_O_r_I_d _i_n_d_e_x This command returns a decimal string giving the numerical index within _t_a_g_O_r_I_d corresponding to _i_n_d_e_x. _I_n_d_e_x gives a textual description of the desired position as described in INDICES above. The return value is guaranteed to lie between 0 and the number of characters within the item, inclusive. If _t_a_g_O_r_I_d refers to multiple items, then the index is processed in the first of these items that supports indexing operations (in display list order). _p_a_t_h_N_a_m_e iiiinnnnsssseeeerrrrtttt _t_a_g_O_r_I_d _b_e_f_o_r_e_T_h_i_s _s_t_r_i_n_g For each of the items given by _t_a_g_O_r_I_d, if the item supports text insertion then _s_t_r_i_n_g is inserted into the item's text just before the character whose index is _b_e_f_o_r_e_T_h_i_s. See INDICES above for information about the forms allowed for _b_e_f_o_r_e_T_h_i_s. This command returns an empty string. _p_a_t_h_N_a_m_e iiiitttteeeemmmmccccggggeeeetttt _t_a_g_O_r_I_d _o_p_t_i_o_n Returns the current value of the configuration option for the item | given by _t_a_g_O_r_I_d whose name is _o_p_t_i_o_n. This command is similar to | the ccccggggeeeetttt widget command except that it applies to a particular item | rather than the widget as a whole. _O_p_t_i_o_n may have any of the | values accepted by the ccccrrrreeeeaaaatttteeee widget command when the item was | created. If _t_a_g_O_r_I_d is a tag that refers to more than one item, the| first (lowest) such item is used. PPPPaaaaggggeeee 9999 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) _p_a_t_h_N_a_m_e iiiitttteeeemmmmccccoooonnnnffffiiiigggguuuurrrreeee _t_a_g_O_r_I_d ?_o_p_t_i_o_n? ?_v_a_l_u_e? ?_o_p_t_i_o_n _v_a_l_u_e ...? This command is similar to the ccccoooonnnnffffiiiigggguuuurrrreeee widget command except that it modifies item-specific options for the items given by _t_a_g_O_r_I_d instead of modifying options for the overall canvas widget. If no _o_p_t_i_o_n is specified, returns a list describing all of the available options for the first item given by _t_a_g_O_r_I_d (see TTTTkkkk____CCCCoooonnnnffffiiiigggguuuurrrreeeeIIIInnnnffffoooo for information on the format of this list). If _o_p_t_i_o_n is specified with no _v_a_l_u_e, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no _o_p_t_i_o_n is specified). If one or more _o_p_t_i_o_n-_v_a_l_u_e pairs are specified, then the command modifies the given widget option(s) to have the given value(s) in each of the items given by _t_a_g_O_r_I_d; in this case the command returns an empty string. The _o_p_t_i_o_ns and _v_a_l_u_es are the same as those permissible in the ccccrrrreeeeaaaatttteeee widget command when the item(s) were created; see the sections describing individual item types below for details on the legal options. _p_a_t_h_N_a_m_e lllloooowwwweeeerrrr _t_a_g_O_r_I_d ?_b_e_l_o_w_T_h_i_s? Move all of the items given by _t_a_g_O_r_I_d to a new position in the display list just before the item given by _b_e_l_o_w_T_h_i_s. If _t_a_g_O_r_I_d refers to more than one item then all are moved but the relative order of the moved items will not be changed. _B_e_l_o_w_T_h_i_s is a tag or id; if it refers to more than one item then the first (lowest) of these items in the display list is used as the destination location for the moved items. This command returns an empty string. _p_a_t_h_N_a_m_e mmmmoooovvvveeee _t_a_g_O_r_I_d _x_A_m_o_u_n_t _y_A_m_o_u_n_t Move each of the items given by _t_a_g_O_r_I_d in the canvas coordinate space by adding _x_A_m_o_u_n_t to the x-coordinate of each point associated with the item and _y_A_m_o_u_n_t to the y-coordinate of each point associated with the item. This command returns an empty string. _p_a_t_h_N_a_m_e ppppoooossssttttssssccccrrrriiiipppptttt ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...? Generate a Postscript representation for part or all of the canvas. If the ----ffffiiiilllleeee option is specified then the Postscript is written to a file and an empty string is returned; otherwise the Postscript is returned as the result of the command. The Postscript is created in Encapsulated Postscript form using version 3.0 of the Document Structuring Conventions. The _o_p_t_i_o_n-_v_a_l_u_e argument pairs provide additional information to control the generation of Postscript. The following options are supported: ----ccccoooolllloooorrrrmmmmaaaapppp _v_a_r_N_a_m_e _V_a_r_N_a_m_e must be the name of an array variable that specifies a color mapping to use in the Postscript. Each element of _v_a_r_N_a_m_e must consist of Postscript code to set a particular color value (e.g. ``1111....0000 1111....0000 0000....0000 sssseeeettttrrrrggggbbbbccccoooolllloooorrrr''). When outputting color information in the Postscript, Tk checks to see if there is an element of _v_a_r_N_a_m_e with the same name as the color. If so, Tk uses the value of the element as the Postscript command to set the color. If this option hasn't PPPPaaaaggggeeee 11110000 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) been specified, or if there isn't an entry in _v_a_r_N_a_m_e for a given color, then Tk uses the red, green, and blue intensities from the X color. ----ccccoooolllloooorrrrmmmmooooddddeeee _m_o_d_e Specifies how to output color information. _M_o_d_e must be either ccccoooolllloooorrrr (for full color output), ggggrrrraaaayyyy (convert all colors to their gray-scale equivalents) or mmmmoooonnnnoooo (convert all colors to black or white). ----ffffiiiilllleeee _f_i_l_e_N_a_m_e Specifies the name of the file in which to write the Postscript. If this option isn't specified then the Postscript is returned as the result of the command instead of being written to a file. ----ffffoooonnnnttttmmmmaaaapppp _v_a_r_N_a_m_e _V_a_r_N_a_m_e must be the name of an array variable that specifies a font mapping to use in the Postscript. Each element of _v_a_r_N_a_m_e must consist of a Tcl list with two elements, which are the name and point size of a Postscript font. When outputting Postscript commands for a particular font, Tk checks to see if _v_a_r_N_a_m_e contains an element with the same name as the font. If there is such an element, then the font information contained in that element is used in the Postscript. Otherwise Tk attempts to guess what Postscript font to use. Tk's guesses generally only work for well-known fonts such as Times and Helvetica and Courier, and only if the X font name does not omit any dashes up through the point size. For example, ----****----CCCCoooouuuurrrriiiieeeerrrr----BBBBoooolllldddd----RRRR----NNNNoooorrrrmmmmaaaallll--------****----111122220000----**** will work but ****CCCCoooouuuurrrriiiieeeerrrr----BBBBoooolllldddd----RRRR----NNNNoooorrrrmmmmaaaallll****111122220000**** will not; Tk needs the dashes to parse the font name). ----hhhheeeeiiiigggghhhhtttt _s_i_z_e Specifies the height of the area of the canvas to print. Defaults to the height of the canvas window. ----ppppaaaaggggeeeeaaaannnncccchhhhoooorrrr _a_n_c_h_o_r Specifies which point of the printed area should be appear over the positioning point on the page (which is given by the ----ppppaaaaggggeeeexxxx and ----ppppaaaaggggeeeeyyyy options). For example, ----ppppaaaaggggeeeeaaaannnncccchhhhoooorrrr nnnn means that the top center of the printed area should be over the positioning point. Defaults to cccceeeennnntttteeeerrrr. ----ppppaaaaggggeeeehhhheeeeiiiigggghhhhtttt _s_i_z_e Specifies that the Postscript should be scaled in both x and y so that the printed area is _s_i_z_e high on the Postscript page. _S_i_z_e consists of a floating-point number followed by cccc for centimeters, iiii for inches, mmmm for millimeters, or pppp or nothing for printer's points (1/72 inch). Defaults to the height of the printed area on the screen. If both ----ppppaaaaggggeeeehhhheeeeiiiigggghhhhtttt and ----ppppaaaaggggeeeewwwwiiiiddddtttthhhh are specified then the scale factor from the later PPPPaaaaggggeeee 11111111 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) option is used (non-uniform scaling is not implemented). ----ppppaaaaggggeeeewwwwiiiiddddtttthhhh _s_i_z_e Specifies that the Postscript should be scaled in both x and y so that the printed area is _s_i_z_e wide on the Postscript page. _S_i_z_e has the same form as for ----ppppaaaaggggeeeehhhheeeeiiiigggghhhhtttt. Defaults to the width of the printed area on the screen. If both ----ppppaaaaggggeeeehhhheeeeiiiigggghhhhtttt and ----ppppaaaaggggeeeewwwwiiiiddddtttthhhh are specified then the scale factor from the later option is used (non-uniform scaling is not implemented). ----ppppaaaaggggeeeexxxx _p_o_s_i_t_i_o_n _P_o_s_i_t_i_o_n gives the x-coordinate of the positioning point on the Postscript page, using any of the forms allowed for ----ppppaaaaggggeeeehhhheeeeiiiigggghhhhtttt. Used in conjunction with the ----ppppaaaaggggeeeeyyyy and ----ppppaaaaggggeeeeaaaannnncccchhhhoooorrrr options to determine where the printed area appears on the Postscript page. Defaults to the center of the page. ----ppppaaaaggggeeeeyyyy _p_o_s_i_t_i_o_n _P_o_s_i_t_i_o_n gives the y-coordinate of the positioning point on the Postscript page, using any of the forms allowed for ----ppppaaaaggggeeeehhhheeeeiiiigggghhhhtttt. Used in conjunction with the ----ppppaaaaggggeeeexxxx and ----ppppaaaaggggeeeeaaaannnncccchhhhoooorrrr options to determine where the printed area appears on the Postscript page. Defaults to the center of the page. ----rrrroooottttaaaatttteeee _b_o_o_l_e_a_n _B_o_o_l_e_a_n specifies whether the printed area is to be rotated 90 degrees. In non-rotated output the x-axis of the printed area runs along the short dimension of the page (``portrait'' orientation); in rotated output the x-axis runs along the long dimension of the page (``landscape'' orientation). Defaults to non-rotated. ----wwwwiiiiddddtttthhhh _s_i_z_e Specifies the width of the area of the canvas to print. Defaults to the width of the canvas window. ----xxxx _p_o_s_i_t_i_o_n Specifies the x-coordinate of the left edge of the area of the canvas that is to be printed, in canvas coordinates, not window coordinates. Defaults to the coordinate of the left edge of the window. ----yyyy _p_o_s_i_t_i_o_n Specifies the y-coordinate of the top edge of the area of the canvas that is to be printed, in canvas coordinates, not window coordinates. Defaults to the coordinate of the top edge of the window. _p_a_t_h_N_a_m_e rrrraaaaiiiisssseeee _t_a_g_O_r_I_d ?_a_b_o_v_e_T_h_i_s? Move all of the items given by _t_a_g_O_r_I_d to a new position in the display list just after the item given by _a_b_o_v_e_T_h_i_s. If _t_a_g_O_r_I_d refers to more than one item then all are moved but the relative PPPPaaaaggggeeee 11112222 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) order of the moved items will not be changed. _A_b_o_v_e_T_h_i_s is a tag or id; if it refers to more than one item then the last (topmost) of these items in the display list is used as the destination location for the moved items. This command returns an empty string. _p_a_t_h_N_a_m_e ssssccccaaaalllleeee _t_a_g_O_r_I_d _x_O_r_i_g_i_n _y_O_r_i_g_i_n _x_S_c_a_l_e _y_S_c_a_l_e Rescale all of the items given by _t_a_g_O_r_I_d in canvas coordinate space. _X_O_r_i_g_i_n and _y_O_r_i_g_i_n identify the origin for the scaling operation and _x_S_c_a_l_e and _y_S_c_a_l_e identify the scale factors for x- and y-coordinates, respectively (a scale factor of 1.0 implies no change to that coordinate). For each of the points defining each item, the x-coordinate is adjusted to change the distance from _x_O_r_i_g_i_n by a factor of _x_S_c_a_l_e. Similarly, each y-coordinate is adjusted to change the distance from _y_O_r_i_g_i_n by a factor of _y_S_c_a_l_e. This command returns an empty string. _p_a_t_h_N_a_m_e ssssccccaaaannnn _o_p_t_i_o_n _a_r_g_s This command is used to implement scanning on canvases. It has two forms, depending on _o_p_t_i_o_n: _p_a_t_h_N_a_m_e ssssccccaaaannnn mmmmaaaarrrrkkkk _x _y Records _x and _y and the canvas's current view; used in conjunction with later ssssccccaaaannnn ddddrrrraaaaggggttttoooo commands. Typically this command is associated with a mouse button press in the widget and _x and _y are the coordinates of the mouse. It returns an empty string. _p_a_t_h_N_a_m_e ssssccccaaaannnn ddddrrrraaaaggggttttoooo _x _y. This command computes the difference between its _x and _y arguments (which are typically mouse coordinates) and the _x and _y arguments to the last ssssccccaaaannnn mmmmaaaarrrrkkkk command for the widget. It then adjusts the view by 10 times the difference in coordinates. This command is typically associated with mouse motion events in the widget, to produce the effect of dragging the canvas at high speed through its window. The return value is an empty string. _p_a_t_h_N_a_m_e sssseeeelllleeeecccctttt _o_p_t_i_o_n ?_t_a_g_O_r_I_d _a_r_g? Manipulates the selection in one of several ways, depending on _o_p_t_i_o_n. The command may take any of the forms described below. In all of the descriptions below, _t_a_g_O_r_I_d must refer to an item that supports indexing and selection; if it refers to multiple items then the first of these that supports indexing and the selection is used. _I_n_d_e_x gives a textual description of a position within _t_a_g_O_r_I_d, as described in INDICES above. _p_a_t_h_N_a_m_e sssseeeelllleeeecccctttt aaaaddddjjjjuuuusssstttt _t_a_g_O_r_I_d _i_n_d_e_x Locate the end of the selection in _t_a_g_O_r_I_d nearest to the character given by _i_n_d_e_x, and adjust that end of the selection to be at _i_n_d_e_x (i.e. including but not going beyond _i_n_d_e_x). The other end of the selection is made the anchor point for future sssseeeelllleeeecccctttt ttttoooo commands. If the selection isn't currently in PPPPaaaaggggeeee 11113333 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) _t_a_g_O_r_I_d then this command behaves the same as the sssseeeelllleeeecccctttt ttttoooo widget command. Returns an empty string. _p_a_t_h_N_a_m_e sssseeeelllleeeecccctttt cccclllleeeeaaaarrrr Clear the selection if it is in this widget. If the selection isn't in this widget then the command has no effect. Returns an empty string. _p_a_t_h_N_a_m_e sssseeeelllleeeecccctttt ffffrrrroooommmm _t_a_g_O_r_I_d _i_n_d_e_x Set the selection anchor point for the widget to be just before the character given by _i_n_d_e_x in the item given by _t_a_g_O_r_I_d. This command doesn't change the selection; it just sets the fixed end of the selection for future sssseeeelllleeeecccctttt ttttoooo commands. Returns an empty string. _p_a_t_h_N_a_m_e sssseeeelllleeeecccctttt iiiitttteeeemmmm Returns the id of the selected item, if the selection is in an item in this canvas. If the selection is not in this canvas then an empty string is returned. _p_a_t_h_N_a_m_e sssseeeelllleeeecccctttt ttttoooo _t_a_g_O_r_I_d _i_n_d_e_x Set the selection to consist of those characters of _t_a_g_O_r_I_d between the selection anchor point and _i_n_d_e_x. The new selection will include the character given by _i_n_d_e_x; it will include the character given by the anchor point only if _i_n_d_e_x is greater than or equal to the anchor point. The anchor point is determined by the most recent sssseeeelllleeeecccctttt aaaaddddjjjjuuuusssstttt or sssseeeelllleeeecccctttt ffffrrrroooommmm command for this widget. If the selection anchor point for the widget isn't currently in _t_a_g_O_r_I_d, then it is set to the same character given by _i_n_d_e_x. Returns an empty string. _p_a_t_h_N_a_m_e ttttyyyyppppeeee _t_a_g_O_r_I_d Returns the type of the item given by _t_a_g_O_r_I_d, such as rrrreeeeccccttttaaaannnngggglllleeee or tttteeeexxxxtttt. If _t_a_g_O_r_I_d refers to more than one item, then the type of the first item in the display list is returned. If _t_a_g_O_r_I_d doesn't refer to any items at all then an empty string is returned. _p_a_t_h_N_a_m_e xxxxvvvviiiieeeewwww ?_a_r_g_s? This command is used to query and change the horizontal position of | the information displayed in the canvas's window. It can take any | of the following forms: _p_a_t_h_N_a_m_e xxxxvvvviiiieeeewwww Returns a list containing two elements. Each element is a real| fraction between 0 and 1; together they describe the | horizontal span that is visible in the window. For example, if| the first element is .2 and the second element is .6, 20% of | the canvas's area (as defined by the ----ssssccccrrrroooollllllllrrrreeeeggggiiiioooonnnn option) is | off-screen to the left, the middle 40% is visible in the | window, and 40% of the canvas is off-screen to the right. | These are the same values passed to scrollbars via the | ----xxxxssssccccrrrroooollllllllccccoooommmmmmmmaaaannnndddd option. PPPPaaaaggggeeee 11114444 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) _p_a_t_h_N_a_m_e xxxxvvvviiiieeeewwww mmmmoooovvvveeeettttoooo _f_r_a_c_t_i_o_n Adjusts the view in the window so that _f_r_a_c_t_i_o_n of the total | width of the canvas is off-screen to the left. _F_r_a_c_t_i_o_n must | be a fraction between 0 and 1. _p_a_t_h_N_a_m_e xxxxvvvviiiieeeewwww ssssccccrrrroooollllllll _n_u_m_b_e_r _w_h_a_t This command shifts the view in the window left or right | according to _n_u_m_b_e_r and _w_h_a_t. _N_u_m_b_e_r must be an integer. _W_h_a_t| must be either uuuunnnniiiittttssss or ppppaaaaggggeeeessss or an abbreviation of one of | these. If _w_h_a_t is uuuunnnniiiittttssss, the view adjusts left or right in | units of the xxxxSSSSccccrrrroooollllllllIIIInnnnccccrrrreeeemmmmeeeennnntttt option, if it is greater than | zero, or in units of one-tenth the window's width otherwise. | If _w_h_a_t _i_s ppppaaaaggggeeeessss then the view adjusts in units of nine-tenths | the window's width. If _n_u_m_b_e_r is negative then information | farther to the left becomes visible; if it is positive then | information farther to the right becomes visible. _p_a_t_h_N_a_m_e yyyyvvvviiiieeeewwww ?_a_r_g_s? This command is used to query and change the vertical position of | the information displayed in the canvas's window. It can take any | of the following forms: _p_a_t_h_N_a_m_e yyyyvvvviiiieeeewwww Returns a list containing two elements. Each element is a real| fraction between 0 and 1; together they describe the vertical | span that is visible in the window. For example, if the first | element is .6 and the second element is 1.0, the lowest 40% of | the canvas's area (as defined by the ----ssssccccrrrroooollllllllrrrreeeeggggiiiioooonnnn option) is | visible in the window. These are the same values passed to | scrollbars via the ----yyyyssssccccrrrroooollllllllccccoooommmmmmmmaaaannnndddd option. _p_a_t_h_N_a_m_e yyyyvvvviiiieeeewwww mmmmoooovvvveeeettttoooo _f_r_a_c_t_i_o_n Adjusts the view in the window so that _f_r_a_c_t_i_o_n of the canvas's| area is off-screen to the top. _F_r_a_c_t_i_o_n is a fraction between | 0 and 1. _p_a_t_h_N_a_m_e yyyyvvvviiiieeeewwww ssssccccrrrroooollllllll _n_u_m_b_e_r _w_h_a_t This command adjusts the view in the window up or down | according to _n_u_m_b_e_r and _w_h_a_t. _N_u_m_b_e_r must be an integer. _W_h_a_t| must be either uuuunnnniiiittttssss or ppppaaaaggggeeeessss. If _w_h_a_t is uuuunnnniiiittttssss, the view | adjusts up or down in units of the yyyySSSSccccrrrroooollllllllIIIInnnnccccrrrreeeemmmmeeeennnntttt option, if | it is greater than zero, or in units of one-tenth the window's | height otherwise. If _w_h_a_t is ppppaaaaggggeeeessss then the view adjusts in | units of nine-tenths the window's height. If _n_u_m_b_e_r is | negative then higher information becomes visible; if it is | positive then lower information becomes visible. | OOOOVVVVEEEERRRRVVVVIIIIEEEEWWWW OOOOFFFF IIIITTTTEEEEMMMM TTTTYYYYPPPPEEEESSSS The sections below describe the various types of items supported by canvas widgets. Each item type is characterized by two things: first, the form of the ccccrrrreeeeaaaatttteeee command used to create instances of the type; and PPPPaaaaggggeeee 11115555 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) second, a set of configuration options for items of that type, which may be used in the ccccrrrreeeeaaaatttteeee and iiiitttteeeemmmmccccoooonnnnffffiiiigggguuuurrrreeee widget commands. Most items don't support indexing or selection or the commands related to them, such as iiiinnnnddddeeeexxxx and iiiinnnnsssseeeerrrrtttt. Where items do support these facilities, it is noted explicitly in the descriptions below (at present, only text items provide this support). AAAARRRRCCCC IIIITTTTEEEEMMMMSSSS Items of type aaaarrrrcccc appear on the display as arc-shaped regions. An arc is a section of an oval delimited by two angles (specified by the ----ssssttttaaaarrrrtttt and ----eeeexxxxtttteeeennnntttt options) and displayed in one of several ways (specified by the ----ssssttttyyyylllleeee option). Arcs are created with widget commands of the following form: _p_a_t_h_N_a_m_e ccccrrrreeeeaaaatttteeee aaaarrrrcccc _x_1 _y_1 _x_2 _y_2 ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...? The arguments _x_1, _y_1, _x_2, and _y_2 give the coordinates of two diagonally opposite corners of a rectangular region enclosing the oval that defines the arc. After the coordinates there may be any number of _o_p_t_i_o_n-_v_a_l_u_e pairs, each of which sets one of the configuration options for the item. These same _o_p_t_i_o_n-_v_a_l_u_e pairs may be used in iiiitttteeeemmmmccccoooonnnnffffiiiigggguuuurrrreeee widget commands to change the item's configuration. The following options are supported for arcs: ----eeeexxxxtttteeeennnntttt _d_e_g_r_e_e_s Specifies the size of the angular range occupied by the arc. The arc's range extends for _d_e_g_r_e_e_s degrees counter-clockwise from the starting angle given by the ----ssssttttaaaarrrrtttt option. _D_e_g_r_e_e_s may be negative.| If it is greater than 360 or less than -360, then _d_e_g_r_e_e_s modulo 360| is used as the extent. ----ffffiiiillllllll _c_o_l_o_r Fill the region of the arc with _c_o_l_o_r. _C_o_l_o_r may have any of the forms accepted by TTTTkkkk____GGGGeeeettttCCCCoooolllloooorrrr. If _c_o_l_o_r is an empty string (the default), then then the arc will not be filled. ----oooouuuuttttlllliiiinnnneeee _c_o_l_o_r _C_o_l_o_r specifies a color to use for drawing the arc's outline; it may have any of the forms accepted by TTTTkkkk____GGGGeeeettttCCCCoooolllloooorrrr. This option defaults to bbbbllllaaaacccckkkk. If _c_o_l_o_r is specified as an empty string then no outline is drawn for the arc. ----oooouuuuttttlllliiiinnnneeeessssttttiiiipppppppplllleeee _b_i_t_m_a_p Indicates that the outline for the arc should be drawn with a | stipple pattern; _b_i_t_m_a_p specifies the stipple pattern to use, in any| of the forms accepted by TTTTkkkk____GGGGeeeettttBBBBiiiittttmmmmaaaapppp. If the ----oooouuuuttttlllliiiinnnneeee option | hasn't been specified then this option has no effect. If _b_i_t_m_a_p is | an empty string (the default), then the outline is drawn in a solid | fashion. PPPPaaaaggggeeee 11116666 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ----ssssttttaaaarrrrtttt _d_e_g_r_e_e_s Specifies the beginning of the angular range occupied by the arc. _D_e_g_r_e_e_s is given in units of degrees measured counter-clockwise from the 3-o'clock position; it may be either positive or negative. ----ssssttttiiiipppppppplllleeee _b_i_t_m_a_p Indicates that the arc should be filled in a stipple pattern; _b_i_t_m_a_p specifies the stipple pattern to use, in any of the forms accepted by TTTTkkkk____GGGGeeeettttBBBBiiiittttmmmmaaaapppp. If the ----ffffiiiillllllll option hasn't been specified then this option has no effect. If _b_i_t_m_a_p is an empty string (the default), then filling is done in a solid fashion. ----ssssttttyyyylllleeee _t_y_p_e Specifies how to draw the arc. If _t_y_p_e is ppppiiiieeeesssslllliiiicccceeee (the default) then the arc's region is defined by a section of the oval's perimeter plus two line segments, one between the center of the oval and each end of the perimeter section. If _t_y_p_e is cccchhhhoooorrrrdddd then the arc's region is defined by a section of the oval's perimeter plus a single line segment connecting the two end points of the perimeter section. If _t_y_p_e is aaaarrrrcccc then the arc's region consists of a section of the perimeter alone. In this last case the ----ffffiiiillllllll option is | ignored. ----ttttaaaaggggssss _t_a_g_L_i_s_t Specifies a set of tags to apply to the item. _T_a_g_L_i_s_t consists of a list of tag names, which replace any existing tags for the item. _T_a_g_L_i_s_t may be an empty list. ----wwwwiiiiddddtttthhhh _o_u_t_l_i_n_e_W_i_d_t_h Specifies the width of the outline to be drawn around the arc's region, in any of the forms described in the COORDINATES section above. If the ----oooouuuuttttlllliiiinnnneeee option has been specified as an empty string then this option has no effect. Wide outlines will be drawn centered on the edges of the arc's region. This option defaults to 1.0. BBBBIIIITTTTMMMMAAAAPPPP IIIITTTTEEEEMMMMSSSS Items of type bbbbiiiittttmmmmaaaapppp appear on the display as images with two colors, foreground and background. Bitmaps are created with widget commands of the following form: _p_a_t_h_N_a_m_e ccccrrrreeeeaaaatttteeee bbbbiiiittttmmmmaaaapppp _x _y ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...? The arguments _x and _y specify the coordinates of a point used to position the bitmap on the display (see the ----aaaannnncccchhhhoooorrrr option below for more information on how bitmaps are displayed). After the coordinates there may be any number of _o_p_t_i_o_n-_v_a_l_u_e pairs, each of which sets one of the configuration options for the item. These same _o_p_t_i_o_n-_v_a_l_u_e pairs may be used in iiiitttteeeemmmmccccoooonnnnffffiiiigggguuuurrrreeee widget commands to change the item's configuration. The following options are supported for bitmaps: PPPPaaaaggggeeee 11117777 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ----aaaannnncccchhhhoooorrrr _a_n_c_h_o_r_P_o_s _A_n_c_h_o_r_P_o_s tells how to position the bitmap relative to the positioning point for the item; it may have any of the forms accepted by TTTTkkkk____GGGGeeeettttAAAAnnnncccchhhhoooorrrr. For example, if _a_n_c_h_o_r_P_o_s is cccceeeennnntttteeeerrrr then the bitmap is centered on the point; if _a_n_c_h_o_r_P_o_s is nnnn then the bitmap will be drawn so that its top center point is at the positioning point. This option defaults to cccceeeennnntttteeeerrrr. ----bbbbaaaacccckkkkggggrrrroooouuuunnnndddd _c_o_l_o_r Specifies a color to use for each of the bitmap pixels whose value is 0. _C_o_l_o_r may have any of the forms accepted by TTTTkkkk____GGGGeeeettttCCCCoooolllloooorrrr. If this option isn't specified, or if it is specified as an empty | string, then nothing is displayed where the bitmap pixels are 0; | this produces a transparent effect. ----bbbbiiiittttmmmmaaaapppp _b_i_t_m_a_p Specifies the bitmap to display in the item. _B_i_t_m_a_p may have any of the forms accepted by TTTTkkkk____GGGGeeeettttBBBBiiiittttmmmmaaaapppp. ----ffffoooorrrreeeeggggrrrroooouuuunnnndddd _c_o_l_o_r Specifies a color to use for each of the bitmap pixels whose value is 1. _C_o_l_o_r may have any of the forms accepted by TTTTkkkk____GGGGeeeettttCCCCoooolllloooorrrr and defaults to bbbbllllaaaacccckkkk. ----ttttaaaaggggssss _t_a_g_L_i_s_t Specifies a set of tags to apply to the item. _T_a_g_L_i_s_t consists of a list of tag names, which replace any existing tags for the item. _T_a_g_L_i_s_t may be an empty list. IIIIMMMMAAAAGGGGEEEE IIIITTTTEEEEMMMMSSSS Items of type iiiimmmmaaaaggggeeee are used to display images on a canvas. Images are | created with widget commands of the following form: | _p_a_t_h_N_a_m_e ccccrrrreeeeaaaatttteeee iiiimmmmaaaaggggeeee _x _y ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...? | The arguments _x and _y specify the coordinates of a point used to position| the image on the display (see the ----aaaannnncccchhhhoooorrrr option below for more | information). After the coordinates there may be any number of | _o_p_t_i_o_n-_v_a_l_u_e pairs, each of which sets one of the configuration options | for the item. These same _o_p_t_i_o_n-_v_a_l_u_e pairs may be used in iiiitttteeeemmmmccccoooonnnnffffiiiigggguuuurrrreeee| widget commands to change the item's configuration. The following | options are supported for images: ----aaaannnncccchhhhoooorrrr _a_n_c_h_o_r_P_o_s _A_n_c_h_o_r_P_o_s tells how to position the image relative to the | positioning point for the item; it may have any of the forms | accepted by TTTTkkkk____GGGGeeeettttAAAAnnnncccchhhhoooorrrr. For example, if _a_n_c_h_o_r_P_o_s is cccceeeennnntttteeeerrrr then | the image is centered on the point; if _a_n_c_h_o_r_P_o_s is nnnn then the | image will be drawn so that its top center point is at the | positioning point. This option defaults to cccceeeennnntttteeeerrrr. PPPPaaaaggggeeee 11118888 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ----iiiimmmmaaaaggggeeee _n_a_m_e Specifies the name of the image to display in the item. This image | must have been created previously with the iiiimmmmaaaaggggeeee ccccrrrreeeeaaaatttteeee command. ----ttttaaaaggggssss _t_a_g_L_i_s_t Specifies a set of tags to apply to the item. _T_a_g_L_i_s_t consists of a| list of tag names, which replace any existing tags for the item; it| may be an empty list. LLLLIIIINNNNEEEE IIIITTTTEEEEMMMMSSSS Items of type lllliiiinnnneeee appear on the display as one or more connected line segments or curves. Lines are created with widget commands of the following form: _p_a_t_h_N_a_m_e ccccrrrreeeeaaaatttteeee lllliiiinnnneeee _x_1 _y_1... _x_n _y_n ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...? The arguments _x_1 through _y_n give the coordinates for a series of two or more points that describe a series of connected line segments. After the coordinates there may be any number of _o_p_t_i_o_n-_v_a_l_u_e pairs, each of which sets one of the configuration options for the item. These same _o_p_t_i_o_n-_v_a_l_u_e pairs may be used in iiiitttteeeemmmmccccoooonnnnffffiiiigggguuuurrrreeee widget commands to change the item's configuration. The following options are supported for lines: ----aaaarrrrrrrroooowwww _w_h_e_r_e Indicates whether or not arrowheads are to be drawn at one or both ends of the line. _W_h_e_r_e must have one of the values nnnnoooonnnneeee (for no arrowheads), ffffiiiirrrrsssstttt (for an arrowhead at the first point of the line), llllaaaasssstttt (for an arrowhead at the last point of the line), or bbbbooootttthhhh (for arrowheads at both ends). This option defaults to nnnnoooonnnneeee. ----aaaarrrrrrrroooowwwwsssshhhhaaaappppeeee _s_h_a_p_e This option indicates how to draw arrowheads. The _s_h_a_p_e argument must be a list with three elements, each specifying a distance in any of the forms described in the COORDINATES section above. The first element of the list gives the distance along the line from the neck of the arrowhead to its tip. The second element gives the distance along the line from the trailing points of the arrowhead to the tip, and the third element gives the distance from the outside edge of the line to the trailing points. If this option isn't specified then Tk picks a ``reasonable'' shape. ----ccccaaaappppssssttttyyyylllleeee _s_t_y_l_e Specifies the ways in which caps are to be drawn at the endpoints of the line. _S_t_y_l_e may have any of the forms accepted by TTTTkkkk____GGGGeeeettttCCCCaaaappppSSSSttttyyyylllleeee (bbbbuuuutttttttt, pppprrrroooojjjjeeeeccccttttiiiinnnngggg, or rrrroooouuuunnnndddd). If this option isn't specified then it defaults to bbbbuuuutttttttt. Where arrowheads are drawn the cap style is ignored. ----ffffiiiillllllll _c_o_l_o_r _C_o_l_o_r specifies a color to use for drawing the line; it may have any of the forms acceptable to TTTTkkkk____GGGGeeeettttCCCCoooolllloooorrrr. It may also be an empty PPPPaaaaggggeeee 11119999 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) string, in which case the line will be transparent. This option defaults to bbbbllllaaaacccckkkk. ----jjjjooooiiiinnnnssssttttyyyylllleeee _s_t_y_l_e Specifies the ways in which joints are to be drawn at the vertices of the line. _S_t_y_l_e may have any of the forms accepted by TTTTkkkk____GGGGeeeettttCCCCaaaappppSSSSttttyyyylllleeee (bbbbeeeevvvveeeellll, mmmmiiiitttteeeerrrr, or rrrroooouuuunnnndddd). If this option isn't specified then it defaults to mmmmiiiitttteeeerrrr. If the line only contains two points then this option is irrelevant. ----ssssmmmmooooooootttthhhh _b_o_o_l_e_a_n _B_o_o_l_e_a_n must have one of the forms accepted by TTTTkkkk____GGGGeeeettttBBBBoooooooolllleeeeaaaannnn. It indicates whether or not the line should be drawn as a curve. If so, the line is rendered as a set of Bezier splines: one spline is drawn for the first and second line segments, one for the second and third, and so on. Straight-line segments can be generated within a curve by duplicating the end-points of the desired line segment. ----sssspppplllliiiinnnneeeesssstttteeeeppppssss _n_u_m_b_e_r Specifies the degree of smoothness desired for curves: each spline will be approximated with _n_u_m_b_e_r line segments. This option is ignored unless the ----ssssmmmmooooooootttthhhh option is true. ----ssssttttiiiipppppppplllleeee _b_i_t_m_a_p Indicates that the line should be filled in a stipple pattern; _b_i_t_m_a_p specifies the stipple pattern to use, in any of the forms accepted by TTTTkkkk____GGGGeeeettttBBBBiiiittttmmmmaaaapppp. If _b_i_t_m_a_p is an empty string (the default), then filling is done in a solid fashion. ----ttttaaaaggggssss _t_a_g_L_i_s_t Specifies a set of tags to apply to the item. _T_a_g_L_i_s_t consists of a list of tag names, which replace any existing tags for the item. _T_a_g_L_i_s_t may be an empty list. ----wwwwiiiiddddtttthhhh _l_i_n_e_W_i_d_t_h _L_i_n_e_W_i_d_t_h specifies the width of the line, in any of the forms described in the COORDINATES section above. Wide lines will be drawn centered on the path specified by the points. If this option isn't specified then it defaults to 1.0. OOOOVVVVAAAALLLL IIIITTTTEEEEMMMMSSSS Items of type oooovvvvaaaallll appear as circular or oval regions on the display. Each oval may have an outline, a fill, or both. Ovals are created with widget commands of the following form: _p_a_t_h_N_a_m_e ccccrrrreeeeaaaatttteeee oooovvvvaaaallll _x_1 _y_1 _x_2 _y_2 ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...? The arguments _x_1, _y_1, _x_2, and _y_2 give the coordinates of two diagonally opposite corners of a rectangular region enclosing the oval. The oval will include the top and left edges of the rectangle not the lower or right edges. If the region is square then the resulting oval is PPPPaaaaggggeeee 22220000 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) circular; otherwise it is elongated in shape. After the coordinates there may be any number of _o_p_t_i_o_n-_v_a_l_u_e pairs, each of which sets one of the configuration options for the item. These same _o_p_t_i_o_n-_v_a_l_u_e pairs may be used in iiiitttteeeemmmmccccoooonnnnffffiiiigggguuuurrrreeee widget commands to change the item's configuration. The following options are supported for ovals: ----ffffiiiillllllll _c_o_l_o_r Fill the area of the oval with _c_o_l_o_r. _C_o_l_o_r may have any of the forms accepted by TTTTkkkk____GGGGeeeettttCCCCoooolllloooorrrr. If _c_o_l_o_r is an empty string (the default), then then the oval will not be filled. ----oooouuuuttttlllliiiinnnneeee _c_o_l_o_r _C_o_l_o_r specifies a color to use for drawing the oval's outline; it may have any of the forms accepted by TTTTkkkk____GGGGeeeettttCCCCoooolllloooorrrr. This option defaults to bbbbllllaaaacccckkkk. If _c_o_l_o_r is an empty string then no outline will be drawn for the oval. ----ssssttttiiiipppppppplllleeee _b_i_t_m_a_p Indicates that the oval should be filled in a stipple pattern; _b_i_t_m_a_p specifies the stipple pattern to use, in any of the forms accepted by TTTTkkkk____GGGGeeeettttBBBBiiiittttmmmmaaaapppp. If the ----ffffiiiillllllll option hasn't been specified then this option has no effect. If _b_i_t_m_a_p is an empty string (the default), then filling is done in a solid fashion. ----ttttaaaaggggssss _t_a_g_L_i_s_t Specifies a set of tags to apply to the item. _T_a_g_L_i_s_t consists of a list of tag names, which replace any existing tags for the item. _T_a_g_L_i_s_t may be an empty list. ----wwwwiiiiddddtttthhhh _o_u_t_l_i_n_e_W_i_d_t_h _o_u_t_l_i_n_e_W_i_d_t_h specifies the width of the outline to be drawn around the oval, in any of the forms described in the COORDINATES section above. If the ----oooouuuuttttlllliiiinnnneeee option hasn't been specified then this option has no effect. Wide outlines are drawn centered on the oval path defined by _x_1, _y_1, _x_2, and _y_2. This option defaults to 1.0. PPPPOOOOLLLLYYYYGGGGOOOONNNN IIIITTTTEEEEMMMMSSSS Items of type ppppoooollllyyyyggggoooonnnn appear as polygonal or curved filled regions on the display. Polygons are created with widget commands of the following form: _p_a_t_h_N_a_m_e ccccrrrreeeeaaaatttteeee ppppoooollllyyyyggggoooonnnn _x_1 _y_1 ... _x_n _y_n ?_o_p_t_i_o_n _v_a_l_u_e ...? The arguments _x_1 through _y_n specify the coordinates for three or more points that define a closed polygon. The first and last points may be the same; whether they are or not, Tk will draw the polygon as a closed polygon. After the coordinates there may be any number of _o_p_t_i_o_n-_v_a_l_u_e pairs, each of which sets one of the configuration options for the item. These same _o_p_t_i_o_n-_v_a_l_u_e pairs may be used in iiiitttteeeemmmmccccoooonnnnffffiiiigggguuuurrrreeee widget commands to change the item's configuration. The following options are supported for polygons: PPPPaaaaggggeeee 22221111 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ----ffffiiiillllllll _c_o_l_o_r _C_o_l_o_r specifies a color to use for filling the area of the polygon; it may have any of the forms acceptable to TTTTkkkk____GGGGeeeettttCCCCoooolllloooorrrr. If _c_o_l_o_r is an empty string then the polygon will be transparent. This option defaults to bbbbllllaaaacccckkkk. ----oooouuuuttttlllliiiinnnneeee _c_o_l_o_r _C_o_l_o_r specifies a color to use for drawing the polygon's outline; | it may have any of the forms accepted by TTTTkkkk____GGGGeeeettttCCCCoooolllloooorrrr. If _c_o_l_o_r is | an empty string then no outline will be drawn for the polygon. This| option defaults to empty (no outline). ----ssssmmmmooooooootttthhhh _b_o_o_l_e_a_n _B_o_o_l_e_a_n must have one of the forms accepted by TTTTkkkk____GGGGeeeettttBBBBoooooooolllleeeeaaaannnn It indicates whether or not the polygon should be drawn with a curved perimeter. If so, the outline of the polygon becomes a set of Bezier splines, one spline for the first and second line segments, one for the second and third, and so on. Straight-line segments can be generated in a smoothed polygon by duplicating the end-points of the desired line segment. ----sssspppplllliiiinnnneeeesssstttteeeeppppssss _n_u_m_b_e_r Specifies the degree of smoothness desired for curves: each spline will be approximated with _n_u_m_b_e_r line segments. This option is ignored unless the ----ssssmmmmooooooootttthhhh option is true. ----ssssttttiiiipppppppplllleeee _b_i_t_m_a_p Indicates that the polygon should be filled in a stipple pattern; _b_i_t_m_a_p specifies the stipple pattern to use, in any of the forms accepted by TTTTkkkk____GGGGeeeettttBBBBiiiittttmmmmaaaapppp. If _b_i_t_m_a_p is an empty string (the default), then filling is done in a solid fashion. ----ttttaaaaggggssss _t_a_g_L_i_s_t Specifies a set of tags to apply to the item. _T_a_g_L_i_s_t consists of a list of tag names, which replace any existing tags for the item. _T_a_g_L_i_s_t may be an empty list. ----wwwwiiiiddddtttthhhh _o_u_t_l_i_n_e_W_i_d_t_h _O_u_t_l_i_n_e_W_i_d_t_h specifies the width of the outline to be drawn around | the polygon, in any of the forms described in the COORDINATES | section above. If the ----oooouuuuttttlllliiiinnnneeee option hasn't been specified then | this option has no effect. This option defaults to 1.0. | Polygon items are different from other items such as rectangles, ovals | and arcs in that interior points are considered to be ``inside'' a | polygon even if it is not filled. For most other item types, an interior| point is considered to be inside the item only if the item is filled or | if it has neither a fill nor an outline. If you would like an unfilled | polygon whose interior points are not considered to be inside the | polygon, use a line item instead. PPPPaaaaggggeeee 22222222 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) RRRREEEECCCCTTTTAAAANNNNGGGGLLLLEEEE IIIITTTTEEEEMMMMSSSS Items of type rrrreeeeccccttttaaaannnngggglllleeee appear as rectangular regions on the display. Each rectangle may have an outline, a fill, or both. Rectangles are created with widget commands of the following form: _p_a_t_h_N_a_m_e ccccrrrreeeeaaaatttteeee rrrreeeeccccttttaaaannnngggglllleeee _x_1 _y_1 _x_2 _y_2 ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...? The arguments _x_1, _y_1, _x_2, and _y_2 give the coordinates of two diagonally opposite corners of the rectangle (the rectangle will include its upper and left edges but not its lower or right edges). After the coordinates there may be any number of _o_p_t_i_o_n-_v_a_l_u_e pairs, each of which sets one of the configuration options for the item. These same _o_p_t_i_o_n-_v_a_l_u_e pairs may be used in iiiitttteeeemmmmccccoooonnnnffffiiiigggguuuurrrreeee widget commands to change the item's configuration. The following options are supported for rectangles: ----ffffiiiillllllll _c_o_l_o_r Fill the area of the rectangle with _c_o_l_o_r, which may be specified in any of the forms accepted by TTTTkkkk____GGGGeeeettttCCCCoooolllloooorrrr. If _c_o_l_o_r is an empty string (the default), then the rectangle will not be filled. ----oooouuuuttttlllliiiinnnneeee _c_o_l_o_r Draw an outline around the edge of the rectangle in _c_o_l_o_r. _C_o_l_o_r may have any of the forms accepted by TTTTkkkk____GGGGeeeettttCCCCoooolllloooorrrr. This option defaults to bbbbllllaaaacccckkkk. If _c_o_l_o_r is an empty string then no outline will be drawn for the rectangle. ----ssssttttiiiipppppppplllleeee _b_i_t_m_a_p Indicates that the rectangle should be filled in a stipple pattern; _b_i_t_m_a_p specifies the stipple pattern to use, in any of the forms accepted by TTTTkkkk____GGGGeeeettttBBBBiiiittttmmmmaaaapppp. If the ----ffffiiiillllllll option hasn't been specified then this option has no effect. If _b_i_t_m_a_p is an empty string (the default), then filling is done in a solid fashion. ----ttttaaaaggggssss _t_a_g_L_i_s_t Specifies a set of tags to apply to the item. _T_a_g_L_i_s_t consists of a list of tag names, which replace any existing tags for the item. _T_a_g_L_i_s_t may be an empty list. ----wwwwiiiiddddtttthhhh _o_u_t_l_i_n_e_W_i_d_t_h _O_u_t_l_i_n_e_W_i_d_t_h specifies the width of the outline to be drawn around the rectangle, in any of the forms described in the COORDINATES section above. If the ----oooouuuuttttlllliiiinnnneeee option hasn't been specified then this option has no effect. Wide outlines are drawn centered on the rectangular path defined by _x_1, _y_1, _x_2, and _y_2. This option defaults to 1.0. TTTTEEEEXXXXTTTT IIIITTTTEEEEMMMMSSSS A text item displays a string of characters on the screen in one or more lines. Text items support indexing and selection, along with the following text-related canvas widget commands: ddddcccchhhhaaaarrrrssss, ffffooooccccuuuussss, iiiiccccuuuurrrrssssoooorrrr, iiiinnnnddddeeeexxxx, iiiinnnnsssseeeerrrrtttt, sssseeeelllleeeecccctttt. Text items are created with widget commands of PPPPaaaaggggeeee 22223333 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) the following form: _p_a_t_h_N_a_m_e ccccrrrreeeeaaaatttteeee tttteeeexxxxtttt _x _y ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...? The arguments _x and _y specify the coordinates of a point used to position the text on the display (see the options below for more information on how text is displayed). After the coordinates there may be any number of _o_p_t_i_o_n-_v_a_l_u_e pairs, each of which sets one of the configuration options for the item. These same _o_p_t_i_o_n-_v_a_l_u_e pairs may be used in iiiitttteeeemmmmccccoooonnnnffffiiiigggguuuurrrreeee widget commands to change the item's configuration. The following options are supported for text items: ----aaaannnncccchhhhoooorrrr _a_n_c_h_o_r_P_o_s _A_n_c_h_o_r_P_o_s tells how to position the text relative to the positioning point for the text; it may have any of the forms accepted by TTTTkkkk____GGGGeeeettttAAAAnnnncccchhhhoooorrrr. For example, if _a_n_c_h_o_r_P_o_s is cccceeeennnntttteeeerrrr then the text is centered on the point; if _a_n_c_h_o_r_P_o_s is nnnn then the text will be drawn such that the top center point of the rectangular region occupied by the text will be at the positioning point. This option defaults to cccceeeennnntttteeeerrrr. ----ffffiiiillllllll _c_o_l_o_r _C_o_l_o_r specifies a color to use for filling the text characters; it may have any of the forms accepted by TTTTkkkk____GGGGeeeettttCCCCoooolllloooorrrr. If this option isn't specified then it defaults to bbbbllllaaaacccckkkk. ----ffffoooonnnntttt _f_o_n_t_N_a_m_e Specifies the font to use for the text item. _F_o_n_t_N_a_m_e may be any string acceptable to TTTTkkkk____GGGGeeeettttFFFFoooonnnnttttSSSSttttrrrruuuucccctttt. If this option isn't specified, it defaults to a system-dependent font. ----jjjjuuuussssttttiiiiffffyyyy _h_o_w Specifies how to justify the text within its bounding region. _H_o_w must be one of the values lllleeeefffftttt, rrrriiiigggghhhhtttt, or cccceeeennnntttteeeerrrr. This option will only matter if the text is displayed as multiple lines. If the option is omitted, it defaults to lllleeeefffftttt. ----ssssttttiiiipppppppplllleeee _b_i_t_m_a_p Indicates that the text should be drawn in a stippled pattern rather than solid; _b_i_t_m_a_p specifies the stipple pattern to use, in any of the forms accepted by TTTTkkkk____GGGGeeeettttBBBBiiiittttmmmmaaaapppp. If _b_i_t_m_a_p is an empty string (the default) then the text is drawn in a solid fashion. ----ttttaaaaggggssss _t_a_g_L_i_s_t Specifies a set of tags to apply to the item. _T_a_g_L_i_s_t consists of a list of tag names, which replace any existing tags for the item. _T_a_g_L_i_s_t may be an empty list. ----tttteeeexxxxtttt _s_t_r_i_n_g _S_t_r_i_n_g specifies the characters to be displayed in the text item. Newline characters cause line breaks. The characters in the item may also be changed with the iiiinnnnsssseeeerrrrtttt and ddddeeeelllleeeetttteeee widget commands. PPPPaaaaggggeeee 22224444 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) This option defaults to an empty string. ----wwwwiiiiddddtttthhhh _l_i_n_e_L_e_n_g_t_h Specifies a maximum line length for the text, in any of the forms described in the COORDINATES section above. If this option is zero (the default) the text is broken into lines only at newline characters. However, if this option is non-zero then any line that would be longer than _l_i_n_e_L_e_n_g_t_h is broken just before a space character to make the line shorter than _l_i_n_e_L_e_n_g_t_h; the space character is treated as if it were a newline character. WWWWIIIINNNNDDDDOOOOWWWW IIIITTTTEEEEMMMMSSSS Items of type wwwwiiiinnnnddddoooowwww cause a particular window to be displayed at a given position on the canvas. Window items are created with widget commands of the following form: _p_a_t_h_N_a_m_e ccccrrrreeeeaaaatttteeee wwwwiiiinnnnddddoooowwww _x _y ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...? The arguments _x and _y specify the coordinates of a point used to position the window on the display (see the ----aaaannnncccchhhhoooorrrr option below for more information on how bitmaps are displayed). After the coordinates there may be any number of _o_p_t_i_o_n-_v_a_l_u_e pairs, each of which sets one of the configuration options for the item. These same _o_p_t_i_o_n-_v_a_l_u_e pairs may be used in iiiitttteeeemmmmccccoooonnnnffffiiiigggguuuurrrreeee widget commands to change the item's configuration. The following options are supported for window items: ----aaaannnncccchhhhoooorrrr _a_n_c_h_o_r_P_o_s _A_n_c_h_o_r_P_o_s tells how to position the window relative to the positioning point for the item; it may have any of the forms accepted by TTTTkkkk____GGGGeeeettttAAAAnnnncccchhhhoooorrrr. For example, if _a_n_c_h_o_r_P_o_s is cccceeeennnntttteeeerrrr then the window is centered on the point; if _a_n_c_h_o_r_P_o_s is nnnn then the window will be drawn so that its top center point is at the positioning point. This option defaults to cccceeeennnntttteeeerrrr. ----hhhheeeeiiiigggghhhhtttt _p_i_x_e_l_s Specifies the height to assign to the item's window. _P_i_x_e_l_s may have any of the forms described in the COORDINATES section above. If this option isn't specified, or if it is specified as an empty string, then the window is given whatever height it requests internally. ----ttttaaaaggggssss _t_a_g_L_i_s_t Specifies a set of tags to apply to the item. _T_a_g_L_i_s_t consists of a list of tag names, which replace any existing tags for the item. _T_a_g_L_i_s_t may be an empty list. ----wwwwiiiiddddtttthhhh _p_i_x_e_l_s Specifies the width to assign to the item's window. _P_i_x_e_l_s may have any of the forms described in the COORDINATES section above. If this option isn't specified, or if it is specified as an empty string, then the window is given whatever width it requests PPPPaaaaggggeeee 22225555 ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) ccccaaaannnnvvvvaaaassss((((3333TTTTkkkk)))) internally. ----wwwwiiiinnnnddddoooowwww _p_a_t_h_N_a_m_e Specifies the window to associate with this item. The window specified by _p_a_t_h_N_a_m_e must either be a child of the canvas widget or a child of some ancestor of the canvas widget. _P_a_t_h_N_a_m_e may not refer to a top-level window. AAAAPPPPPPPPLLLLIIIICCCCAAAATTTTIIIIOOOONNNN----DDDDEEEEFFFFIIIINNNNEEEEDDDD IIIITTTTEEEEMMMM TTTTYYYYPPPPEEEESSSS It is possible for individual applications to define new item types for canvas widgets using C code. See the documentation for | TTTTkkkk____CCCCrrrreeeeaaaatttteeeeIIIItttteeeemmmmTTTTyyyyppppeeee. BBBBIIIINNNNDDDDIIIINNNNGGGGSSSS In the current implementation, new canvases are not given any default behavior: you'll have to execute explicit Tcl commands to give the canvas its behavior. CCCCRRRREEEEDDDDIIIITTTTSSSS Tk's canvas widget is a blatant ripoff of ideas from Joel Bartlett's _e_z_d program. _E_z_d provides structured graphics in a Scheme environment and preceded canvases by a year or two. Its simple mechanisms for placing and animating graphical objects inspired the functions of canvases. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS canvas, widget PPPPaaaaggggeeee 22226666